﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ChapterEdit.aspx.cs" Inherits="ChapterEdit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>风险管理系统-章节管理</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <div style="width:450px; float:left; border-style:dotted;">
        章节编号：<asp:TextBox ID="tbChapterNo" runat="server"></asp:TextBox><br />
        章节名称：<asp:TextBox ID="tbChapterName" runat="server"></asp:TextBox><br />
        <asp:Button ID="btnSubmit" runat="server" Text="新增" onclick="btnSubmit_Click" />
        <asp:Label ID="lbStatus" runat="server" Text=""></asp:Label>
    </div>
    <div style="width:450px; border-style:dotted;">
        <asp:GridView ID="gvChapterInfo" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="No" 
            ForeColor="#333333" GridLines="None" 
            onrowcancelingedit="GridView1_RowCancelingEdit" 
            onrowdeleting="gvChapterInfo_RowDeleting" 
            onrowupdating="gvChapterInfo_RowUpdating" 
            onrowediting="gvChapterInfo_RowEditing">
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
            <Columns>
                <asp:BoundField DataField="No" HeaderText="No" InsertVisible="False" 
                    ReadOnly="True" SortExpression="No" />
                    <asp:TemplateField HeaderText="章节编号">
                        <ItemTemplate>
                            <asp:Label ID="lbCNo" Text='<%# Eval("CNo") %>' runat="server"></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="tbCNo" runat="server" Text='<%# Eval("CNo").ToString().Trim()%>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="章节名称">
                        <ItemTemplate>
                            <asp:Label ID="lbCName" Text='<%# Eval("CName") %>' runat="server"></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="tbCName" runat="server" Text='<%# Eval("CName").ToString().Trim()%>'></asp:TextBox>
                        </EditItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/Images/edit.png" CommandName="Edit" ToolTip="编辑"/>
                            <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/Images/delete.png" CommandName="Delete" ToolTip="删除" OnClick='<%# "if (!confirm(\"确认要删除此条数据？删除后不可恢复\")) return false;"%>' />
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:ImageButton ID="btnUpdate" runat="server" ImageUrl="~/Images/ok.png" CommandName="Update"
                                ToolTip="更新" />
                            <asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/Images/cancel.png" CommandName="Cancel"
                                ToolTip="取消" />
                        </EditItemTemplate>
                    </asp:TemplateField>
                
            </Columns>
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#999999" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
    </div>
</asp:Content>

